import java.awt.Point;
import org.rsbot.script.methods.Menu;
import org.rsbot.script.methods.Mouse;
import org.rsbot.script.methods.Objects;
import org.rsbot.script.wrappers.RSObject;

class AionAirCrafter$2 extends AionAirCrafter.ObjectAction
{
  public String getDesc()
  {
    return "Crafting runes.";
  }

  public boolean isValid() {
    return (AionAirCrafter.access$200(this.this$0)) && (AionAirCrafter.access$4200(this.this$0));
  }

  public void process() {
    super.process();
    this.this$0.sleep(200, 400);
    AionAirCrafter.access$4300(this.this$0, this.this$0.random(900, 1200));
    if (this.this$0.random(1, 6) == 3) {
      RSObject localRSObject = AionAirCrafter.access$4400(this.this$0).getNearest(new int[] { 2465 });
      if (localRSObject != null) {
        Point localPoint = AionAirCrafter.access$3600(this.this$0, localRSObject);
        if ((localPoint.x != -1) && (localPoint.y != -1))
          AionAirCrafter.access$4500(this.this$0).click(localPoint, true);
        else {
          localRSObject.doClick(false);
        }
        if ((AionAirCrafter.access$4600(this.this$0).isOpen()) && 
          (!AionAirCrafter.access$4700(this.this$0).contains("Enter")))
          while (AionAirCrafter.access$4800(this.this$0).isOpen())
            AionAirCrafter.access$4900(this.this$0).moveRandomly(750);
      }
    }
  }
}